package com.lantosec.hmrp.modules.internal.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import com.lantosec.hmrp.modules.internal.entity.*;
import com.lantosec.hmrp.core.mvc.BaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 评价方案 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="InternalPlan对象", description="评价方案")
public class InternalPlanVO extends BaseVO<InternalPlan> {
    private static final long serialVersionUID = 1L;


    public InternalPlanVO(InternalPlan entity){
        this.internalPlanId = entity.getInternalPlanId();
        this.internalPlanName = entity.getInternalPlanName();
        this.internalPlanType = entity.getInternalPlanType();
        this.internalPlanCycle = entity.getInternalPlanCycle();
        this.startDate = entity.getStartDate();
        this.endDate = entity.getEndDate();
        this.executorMode = entity.getExecutorMode();
        this.targetMode = entity.getTargetMode();
        this.state = entity.getState();
        this.delay = entity.getDelay();
        this.managerPost = entity.getManagerPost();
        this.createUserId = entity.getCreateUserId();
        this.createUser = entity.getCreateUser();
        this.createTime = entity.getCreateTime();
        this.editorUserId = entity.getEditorUserId();
        this.editorUser = entity.getEditorUser();
        this.editorTime = entity.getEditorTime();
    }

    @Override
    public InternalPlan convertToEntity(){
        return new InternalPlan(this);
    }


    @ApiModelProperty(value = "评价方案ID")
    @TableId(value = "internal_plan_id", type = IdType.AUTO)
    private Integer internalPlanId;

    @ApiModelProperty(value = "评价方案名称")
    private String internalPlanName;

    @ApiModelProperty(value = "评价方案类型(1科间互评 2科内互评 3评上级领导 4自定义)")
    private Integer internalPlanType;

    @ApiModelProperty(value = "方案周期(0临时 2周 3月 4季度 5年)")
    private Integer internalPlanCycle;

    @ApiModelProperty(value = "方案开始日期")
    private String startDate;

    @ApiModelProperty(value = "方案结束日期")
    private String endDate;

    @ApiModelProperty(value = "评价方形式(1科室 2岗位 3人员)")
    private Integer executorMode;

    @ApiModelProperty(value = "被评价方形式(1科室 2岗位 3人员)")
    private Integer targetMode;

    @ApiModelProperty(value = "方案状态(1暂停 2启用 3到期 4作废)")
    private Integer state;

    @ApiModelProperty(value = "允许延期(工作日)")
    private Integer delay;

    @ApiModelProperty(value = "管理岗是否参评(type=3时可选)")
    private Integer managerPost;

    @ApiModelProperty(value = "创建人ID")
    private String createUserId;

    @ApiModelProperty(value = "创建人")
    private String createUser;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "最后编辑人ID")
    private String editorUserId;

    @ApiModelProperty(value = "最后编辑人")
    private String editorUser;

    @ApiModelProperty(value = "最后编辑时间")
    private Date editorTime;

    @ApiModelProperty(value = "查询考评方案项目")
    private List<InternalPlanItem> internalPlanItemList;
    @ApiModelProperty(value = "查询考评方案的评价方")
    List<InternalPlanExecutor> internalPlanExecutorList;
    @ApiModelProperty(value = "查询考评方案的被评价方")
    List<InternalPlanTarget> internalPlanTargetList;
    @ApiModelProperty(value = "查询考评方案的评价等级")
    List<InternalPlanLevel> internalPlanLevelList;
}
